package cn.jbolt.ec.member;

import cn.jbolt.base.JBoltBaseService;
import cn.jbolt.common.model.BecMemberCoupon;
import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Record;
import java.util.List;

/**
 * @author xieguo
 * @description 会员优惠券业务逻辑层
 */
public class CouponService extends JBoltBaseService<BecMemberCoupon> {
    @Override
    protected BecMemberCoupon dao() {
        return new BecMemberCoupon().dao();
    }

    /**
     * 获取商家优惠券
     * @param member_id
     * @return
     */
    public List<Record> get_member_coupon(Integer member_id){
        long expired=System.currentTimeMillis();
        Kv param =Kv.by("member_id",member_id).set("expired",expired);
        return dbTemplate("ec.mall.shop.member.get_member_coupon",param).find();
    }


}
